package com.zk;

import java.io.PrintWriter;
import java.util.Scanner;

public class App {

    public static void main(String...args) {
        if (args == null || args.length == 0) {
            printUsage();
            System.exit(1);
        }

        AlgoInteraction algoInteraction = null;
        switch (args[0]) {
            case "Median":
                algoInteraction = new FindMedian();
                break;

            case "TSP":
                algoInteraction = new TSPProblem();
                break;

            case "ARC":
                algoInteraction = new ARCProblem();
                break;

            default:
                printUsage();
                System.exit(1);
                break;
        }

        Scanner scanner = new Scanner(System.in);
        PrintWriter printWriter = new PrintWriter(System.out, true);

        algoInteraction.exec(scanner, printWriter);
    }

    private static void printUsage() {
        System.out.println("Usage: java -jar algo.jar [Median|TSP|ARC]");
    }

}
